feat(generic-includer): add linkIndexAutotitle option for directory titles from index.md#1898
Merged
martyanovandrey merged 3 commits intomasterfrom May 5, 2026
Merged
Conversation
12d096f to
1f85900
Compare
separatrixxx
reviewed
May 5, 2026
|
|
||
| if (indexHref) { | ||
| const useIndexHeading = | ||
| options.linkIndexAutotitle === true && options.autotitle !== false; |
Contributor
There was a problem hiding this comment.
Why not options.linkIndexAutotitle && !options.autotitle?
Contributor
Author
There was a problem hiding this comment.
The suggestion inverts the semantics. options.autotitle !== false is true when autotitle is enabled (true or undefined), while !options.autotitle is true when it's disabled (false or undefined). We need the former — deriving a title from index.md's H1 only makes sense when autotitle isn't disabled. The should keep folder name when linkIndexAutotitle is set but autotitle is disabled test covers this.
…linkIndex+autotitle When linkIndex is enabled together with autotitle (the default), let the existing autotitle pipeline derive a directory entry's title from the heading of its nested index.md, instead of always using the directory name. Closes #1872
…dexAutotitle Instead of always deriving the directory entry's title from the index.md heading when linkIndex+autotitle are both enabled, gate the new behavior behind an explicit linkIndexAutotitle option (default false). This preserves backward compatibility with existing linkIndex consumers that rely on folder names for directory titles.
1f85900 to
24f5caa
Compare
24f5caa to
9e6b194
Compare
|
separatrixxx
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
linkIndexAutotitleoption (defaultfalse) to thegenericincluder.linkIndexAutotitle: trueis set together withlinkIndex(andautotitleis not disabled), the directory entry's title is derived from the H1 heading of its nestedindex.mdvia the existing autotitle pipeline. Otherwise the folder name is used (backward-compatible default).Closes #1872